package com.hz.erp.config;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 柯鑫
 * @ClassName com.hz.erp.config.LoginInterceptor
 * @description 登陆拦截器，接受跨域访问的header
 * @create 2020年06月15日 14:21
 */

public class LoginInterceptor /*extends HandlerInterceptorAdapter*/ {

//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
//            throws Exception {
//
//        response.setHeader("Access-Control-Allow-Headers", "X-Requested-With, accept, content-type, xxxx");
//        response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");
//        response.setHeader("Access-Control-Allow-Credentials", "true");
//        response.setHeader("Access-Control-Allow-Origin", "http://127.0.0.1:8080");
//        return true;
//    }
}
